package com.ts.order.service.impl;

import com.ts.common.security.annotation.LoginUser;
import com.ts.common.security.dto.UserToken;
import com.ts.order.dto.OrderDTO;
import com.ts.order.entity.Order;
import com.ts.order.mapper.OrderMapper;
import com.ts.order.service.OrderService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.web.bind.annotation.RequestBody;


@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {
    @Override
    public boolean create(@LoginUser UserToken userToken, @RequestBody OrderDTO orderDTO) {
        Integer userId = userToken.getUserId();
        orderDTO.setUserId(userId);
        return this.save(orderDTO);
    }
}